import 'package:flutter/material.dart';

class CoursePage extends StatefulWidget {
  @override
  State<StatefulWidget> createState() {
    return CourseState();
  }
}

class CourseState extends State {
  String name = "null";
  int age = 0;

  @override
  Widget build(BuildContext context) {
    Map map = ModalRoute.of(context).settings.arguments;
    if (map != null) {
      name = map["name"];
      age = map["age"];
    }
    return Scaffold(
      appBar: AppBar(
        title: Text("课程页面,name:$name,age:$age"),
      ),
      body: Center(
        child: Column(
          children: [
            Text(
              "我是课程页面，我是从windows电脑上传的信息",
              style: TextStyle(fontSize: 30, color: Colors.red),
            ),
            ElevatedButton(
              child: Text("跳转登录"),
              onPressed: () => Navigator.pushNamed(context, "login"),
            )
          ],
        ),
      ),
    );
  }
}
